package com.example.qinghe.util;

import com.example.qinghe.entity.Common;

import java.util.List;

public class MdsUtil {
    public static int infocount(List<Common> commons,Long id) {
        if(commons.size()<1)
            return 0;
        int unread=0;
        String isread="";
        String sid="";
        for (int i = 0; i < commons.size(); i++) {
            isread=(String) commons.get(i).get("isread");
            sid=","+id+",";
            if(isread!=""&&isread!=null&&isread.indexOf(sid)!=-1)
            {
                commons.get(i).put("isread",1);
            }else {
                commons.get(i).put("isread",-1);
                unread++;
            }

        }
        return unread;

    }
}
